package com.study.spring.boot.service.impl;

import com.study.spring.boot.mapper.UserMapper;
import com.study.spring.boot.model.entity.User;
import com.study.spring.boot.service.IUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName: UserServiceImpl
 * @Description: TODO
 * @author: limingxing
 * @Date: 2021/1/10  17:01
 */
@Service
public class UserServiceImpl implements IUserService {

    private Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);

    @Resource
    private UserMapper userMapper;

    @Override
    public User add(User u) {
        int count = userMapper.insert(u);
        if(count > 0){
            return u;
        }
        if(logger.isInfoEnabled()) logger.info("add(): install User fail u={}",u);
        return null;
    }

    @Override
    public User deleteById(Long id) {
        return null;
    }

    @Override
    public User updateBy(User u) {
        return null;
    }

    @Override
    public List<User> getUsers() {
        return null;
    }
}
